<!-- form -->
<script type="text/javascript" src="/Public/js/jquery.form.min.js"></script>

<!-- product.common -->
<script language="javascript" type="text/javascript" src="__PUBLIC__/js/product.common.js"></script>


<!-- dataTables -->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugin/dataTables/media/css/jquery.dataTables.min.css">
<script type="text/javascript" src="__PUBLIC__/plugin/dataTables/media/js/jquery.dataTables.min.js"></script>
<style type="text/css">
textarea{resize: none}
  #labellist,#categoryLabelList ul{ width: 100%; height: 30px;padding: 0;margin: 0;}
  #labellist li,#categoryLabelList li{ float: left; margin-right: 10px;}
  .mt15{ margin-top: 15px;}
  .mt10{ margin-top: 10px;}
  .picture_item {margin:5px;  padding: 5px 5px 40px ; cursor:pointer; width:120px; overflow:hidden;}
  .picture_item2 {border: 1px solid #ff0000;}
  .picture_item .title {padding-left:6px; width: 100%;}
  .page {border-bottom: 0px;}
  .pro-span{display:inline-block;background:#3b8ed3;margin:0 2px;padding:8px 12px;color:#fff;font-size: 12px;vertical-align: middle;line-height: 1;}
  .txtspan{display:inline-block;margin:0 2px;padding:5px;color:#3b8ed3;font-size: 12px;vertical-align: middle;line-height: 1;}
  .ssjgbox{width:550px;min-height:100px;padding: 5px;margin-top:10px;border:1px #c5d6e0 solid;background:#f5f5f5;}
  .ly-addbox{margin: 0 auto;padding: 10px;font-size: 14px;}
  .ly-addbox .label-180{display: block;float: left;width: 180px;text-align: right;}
  .pircebox{position:fixed;top:20%;right:10%;background:#f4f4f4;border:1px #dcdcdc solid;width:260px;min-height:200px;padding:8px 15px;box-sizing:border-box;}
  .pricelist dl{width: 100%;padding: 0;margin:15px 0;list-style: none;}
  .pricelist dl dt{float: left;display:block;width: 80px;text-align: left;color: #939393}
  .pricelist dl dd{float: left;display:block;text-align: left;color: #939393}
  .piclist{ margin-top: 25px;}
  .piclist li{float:left;width:325px;margin-right:30px;margin-bottom: 20px;padding:8px;border:1px #c5d6e0 solid;box-sizing:border-box}
  .l{ float: left;display:block;}
  .r-txt{padding-left:10px;}
  .r-txt p{margin: 4px; padding: 0;}
  .font24{ font-size: 24px;}
  .filebox{width: 150px;height: 120px;border: 1px #CCC solid;position: relative;overflow: hidden;text-align: center;vertical-align: middle;cursor: pointer}
  .filebox .file-btn{width:150px;height: 120px;position: absolute;right: 0;left: 0;bottom: 0;top: 0;margin: auto;opacity: 0;z-index: 9999}
  .filebox .file-imgbox{position: absolute;width: 150px;height: auto;right: 0;left: 0;bottom: 0;top: 0;margin: auto;}
  .probox{width:780px; margin-bottom:25px; border:1px #c5d6e0 solid; padding:10px;}
  .operateDeparture{margin-bottom: 10px;}
  .clearLabel{margin-bottom: 10px;}
</style>
<div class="main_top">
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id))}" class="<if condition="$step eq '0'">bg_blue</if>" >主要信息</a>
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'1'))}" class="<if condition="$step eq '1'">bg_blue</if>" >产品亮点</a>
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'2'))}" class="<if condition="$step eq '2'">bg_blue</if>" >产品详情</a>
   <!-- <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'3'))}" class="<if condition="$step eq '3'">bg_blue</if>" >预定须知</a> -->
   <!-- <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'4'))}" class="<if condition="$step eq '4'">bg_blue</if>" >温馨提示</a> -->
   <!-- <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'5'))}" class="<if condition="$step eq '5'">bg_blue</if>" >当地游</a> -->
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'6'))}" class="<if condition="$step eq '6'">bg_blue</if>" >附加保险</a>
   <!-- <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'7'))}" class="<if condition="$step eq '7'">bg_blue</if>" >优惠券</a> -->
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'8'))}" class="<if condition="$step eq '8'">bg_blue</if>" >附加产品</a>
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'9'))}" class="<if condition="$step eq '9'">bg_blue</if>" >棉签妹推荐</a>
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'10'))}" class="<if condition="$step eq '10'">bg_blue</if>" >包含单品</a>
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'11'))}" class="<if condition="$step eq '11'">bg_blue</if>" >赠送单品</a>
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'12'))}" class="<if condition="$step eq '12'">bg_blue</if>" >出发日期</a>
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'13'))}" class="<if condition="$step eq '13'">bg_blue</if>" >航班信息</a>
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'14'))}" class="<if condition="$step eq '14'">bg_blue</if>" >酒店信息</a>
   <a href="{:U(MODULE_NAME.'/Webproduct/selledit',array('id'=>$id,'step'=>'15'))}" class="<if condition="$step eq '15'">bg_blue</if>" >参考行程</a>
</div>

</script>
<div class="form" >

  <if condition="$step eq '0'">

  <div class="yScroll" id="basicInfo">
    <form method='post' action="{:U('/Home/Webproduct/selledit',array('id'=>$id))}">
      <div class="pircebox">
        <p style="font-size:20px; text-align: center;">当前产品总成本</p>
        <div class="pricelist">
          <foreach name="currDepartureArr" item="currDeparturePirceBoxArr">
          <dl id="libraryID_{$currDeparturePirceBoxArr.id}"><dt>{$currDeparturePirceBoxArr.departureName}出发</dt><dd><font class="red" style="font-size:24px;">{$currDeparturePirceBoxArr.costPrice}</font>元</dd></dl>
          </foreach>
        </div>
      </div>
      <dl>
        <dt>线路名称：</dt>
        <dd>
          <input type="text" name="title" class="inp_one inp_w550" maxlength="30" placeholder="30个字符以内" value="{$product.title}" />
          &nbsp;<input type="checkbox" name="verify"  value="0" />&nbsp;二次确认
        </dd>
      </dl>
      <dl>
        <dt>扩展名称：</dt>
        <dd>
          <input type="text" name="extend" class="inp_one inp_w550" maxlength="35" placeholder="35个字符以内" value="{$product.extend}" />
          &nbsp;<input type="checkbox" name="special" value="1" />&nbsp;特殊产品
        </dd>
      </dl>
      <dl>
        <dt>产品描述：</dt>
        <dd>
          <textarea rows="6" cols="75" name="description" value="" maxlength="300" placeholder="300个字符以内">{$product.description}</textarea>
        </dd>
      </dl>
      <dl>
        <dt> 关键词：</dt>
        <dd>
          <input type="text" name="keyWords" class="inp_one inp_w550" value="{$product.keyWords}" placeholder='英文逗号"|"分隔，数量3个，尽量选择长尾词'/>
        </dd>
      </dl>
      <dl>
        <dt>产品标签：</dt>
        <dd>
            <!-- //产品标签： -->
            <div class="clearLabel" id="classLabel" >
              <foreach name="labelArr" item="labelspan">
                <if condition="$labelspan['checked']">
                <span class="pro-span">
                  <input type="hidden" name="labelID[]" value="{$labelspan.id}">{$labelspan.name}
                  <a href="javascript:;" onclick="delCurrLabel(this,'{$labelspan['id']}')" style="color:#FFF;">X</a>
                </span>
                </if>
              </foreach>
            </div>
            <div class="clearLabel">
              {$productLabelHtml}
              <input type="text" name="labelKeyWords" class="inp_w250">
              <input type="button" onclick="getLabel()" value="查询" style="padding: 6px 10px;border: 0;background-color: coral;color: #FFF;">
            </div>
            <div class="clearLabel">
              <ul id="labellist">
                <foreach name="labelArr" item="label">
                <li style="position: relative;display: block; min-width: 60px; height: 24px;">
                  <input type="checkbox" name="label[]" value="{$label.id}" style="position: absolute; min-width: 60px; height: 24px;  margin-right: 20px; opacity: 0; z-index: 99999;"onclick="currProductLabel(this,'{$label.id}','{$label.name}')" {$label.checked}>
                  <span style="position: absolute; display: block; text-align: center; min-width: 60px; height: 24px;  top:0px; right: 0px; bottom: 0px; left: 0px; margin: auto; cursor: pointer; background-color:<if condition="$label['checked']">#59bc5e<else />#CCC</if>; color: #FFF; line-height: 24px; z-index: 1; ">{$label.name}</span>
                </li>
                </foreach>
              </ul>
            </div>
        </dd>
      </dl>

      <dl>
        <dt>主站分类：</dt>
        <dd>
          <select name="categoryID" onchange="packCategory(this)">
            <option value="0">请选择</option>
            {$classParentOption}
          </select>
          <select name="packCategoryTwo" onChange="categoryLabelList(this)">
            <option value="0">请选择</option>
            {$classChlidOption}
          </select>
        </dd>
      </dl>

      <dl>
        <dt>主站分类标签：</dt>
        <dd id="categoryLabelList">
          <ul>
            <foreach name="classLabelArr" item="classLabelArr">
            <li style="position: relative;display: block; min-width: 60px; height: 24px;">
              <input type="checkbox" style="position: absolute; min-width: 60px; height: 24px;  margin-right: 20px; opacity: 0; z-index: 99999;" name="categorylabel[]" value="{$classLabelArr.id}" onclick="currLabel(this)" {$classLabelArr.checked}>
              <span style="position: absolute; display: block; text-align: center; min-width: 60px; height: 24px;  top:0px; right: 0px; bottom: 0px; left: 0px; margin: auto; cursor: pointer; background-color:<if condition="$classLabelArr['checked']">#59bc5e<else />#CCC</if>; color: #FFF; line-height: 24px; z-index: 1; ">{$classLabelArr.name}</span>
            </li>
            </foreach>
          </ul>
        </dd>
      </dl>
      <dl>
        <dt>出发地：</dt>
          <dd>
            <foreach name="currDepartureArr" item="currDepartureArr">
            <div class="operateDeparture">
              <input type="text" class="inp_small" name="libraryID[]" value="{$currDepartureArr.libraryProductID}" readonly="readonly" >
              <input type="text" class="inp_default" name="libraryTitle[]" value="{$currDepartureArr.libraryTitle}" readonly="readonly" >
              <span>{$currDepartureArr.departureName}</span>
                <select name="addPriceType[]" onchange="changePriceType(this,'{$currDepartureArr.costPrice}')" style="padding:2px 12px;">
                  <option value="0" <if condition="$currDepartureArr['gainType'] eq '0'">selected</if> >成本价</option>
                  <option value="1" <if condition="$currDepartureArr['gainType'] eq '1'">selected</if> >手动输入加价额度</option>
                  <option value="2" <if condition="$currDepartureArr['gainType'] eq '2'">selected</if> >按成本百分比加价%</option>
                </select>

                <input type="text" name="addPriceNums[]" onkeyup="changePriceType(this,'{$currDepartureArr.costPrice}')" style="width:50px;" <if condition="$currDepartureArr['gainType'] eq '0'">disabled</if> value="{$currDepartureArr.gainNums}"> &nbsp;&nbsp;
              <font class="font-green sellPrice">{$currDepartureArr.sellPrice}元</font> &nbsp;&nbsp;
              <a href="javascript:;" onclick="departureCityDel(this,'{$currDepartureArr.libraryID}')">删除</a>
            </div>
            </foreach>

            <div class="selectDepartureNums">
              <a href="javascript:;" onclick="departureCityAdd(this)">新增出发地</a>
            </div>
          </dd>
      </dl>
      <dl>
        <dt> 目的地：</dt>
        <dd>
          <foreach name="currDestinationArr" key="key" item="currDestinationArr">
          <div class="selectDestinationNums">
              <div class="selectDestination" style="float: left;">
                {$currDestinationArr.areaSelect}
                {$currDestinationArr.countrySelect}
                {$currDestinationArr.citySelect}
              </div>
              <if condition="$key eq 0 ">
                <div class="operateDestination" style="float: left;">
                  <a href="javascript:;" onclick="destinationHtmlAdd(this)">添加</a>
                </div>
                  <else />
                <div class="operateDestination" style="float: left;">
                  <a href="javascript:;" onclick="destinationHtmlDel(this)">删除</a>
                </div>
              </if>
              <div class="clear"></div>
          </div>
          </foreach>
        </dd>
      </dl>
      <dl>
        <dt> 行程天数 ：</dt>
        <dd>
          <input type="text" name="travelDays" class="inp_small" value="{$product.travelDays}" />日
          <input type="text" name="travelNight" class="inp_small" value="{$product.travelNight}" />晚
        </dd>
      </dl>
       <dl>
        <dt> 市场价：</dt>
        <dd>
          <input type="text" name="marketPrice" class="inp_small" value="{$product.marketPrice}" /> /人起
        </dd>
      </dl>
      <dl>
        <dt> 现价：</dt>
        <dd>
          <input type="text" name="price" class="inp_small" value="{$product.sellPrice}" /> /人起
        </dd>
      </dl>
       <dl>
        <dt> 产品缩略图：</dt>
        <dd>
          <div>
            <input type="button" class="button-green" value="上传图片" onclick="uploadImgHtml('thumbImages')">
          </div>
          <div><font color="red">(尺寸:320px*210px)</font></div>
          <div style="width: 120px; height: 120px;  border: 1px #CCC solid;   position: relative;   overflow: hidden; text-align: center;vertical-align: middle;cursor: pointer;">
            <div id="thumbImages"  class="fileupload" style="  position: absolute;width: 120px;height: auto;right: 0;left: 0;bottom: 0;top: 0;margin: auto;">
              <img src="{$product.thumbImages}" width="100%" height="100%">
              <input type="hidden" name="thumbImages" value="{$product.thumbImages}">
            </div>
          </div>
        </dd>
      </dl>
      <dl>
        <dt> 产品大图：</dt>
        <dd>
          <div>
            <input type="button" class="button-green" value="上传图片" onclick="uploadImgHtml('originalImages')">
          </div>
        <div><font color="red">(尺寸:宽度1920px为佳，比例2:1)</font></div>
          <div style="width: 300px; height: 120px;  border: 1px #CCC solid;   position: relative;   overflow: hidden; text-align: center;vertical-align: middle;cursor: pointer;" >
            <div id="originalImages" class="fileupload" style="  position: absolute;width: 300px;height: auto;right: 0;left: 0;bottom: 0;top: 0;margin: auto;">
              <img src="{$product.originalImagesPC}" width="100%" height="100%">
              <input type="hidden" name="originalImages" value="{$product.originalImagesPC}">
            </div>
          </div>
        </dd>
      </dl>
      <dl>
        <dt> </dt>
        <dd>
          <input type="submit" class="button-green" value="保 存">
          &nbsp;
          <a href="{:U(MODULE_NAME.'/Webproduct/sell')}" class="button-return">返回产品列表</a>
        </dd>
      </dl>
    </form>

  </div>

  <elseif condition="$step eq '1'" />

  <div class="yScroll" id="productEdge">
    <form method='post' action="{:U('/Home/Webproduct/selledit',array('id'=>$id,'step'=>'1'))}">
      <if condition="$highlight">

      <foreach name="highlight" key="key" item="highlight">
        <dl>
          <dt> 亮点{$key+1}： </dt>
          <dd>
            <input type="text"  name="content[]" class="inp_large" maxlength="8" value="{$highlight.content}" />
            <input type="text"  name="reson[]" class="inp_large" value="{$highlight.reson}" />
            <input type ="hidden"  name="sort[]" value="{$key+1}" />
          </dd>
        </dl>
      </foreach>

      <else />

      <for start="1" end="5">
        <dl>
          <dt> 亮点{$i}： </dt>
          <dd>
            <input type ="text"  name="content[]" class="inp_large" maxlength="8" value="" />
            <input type ="text"  name="reson[]" class="inp_large" value="" />
            <input type ="hidden"  name="sort[]" value="{$i}" />
          </dd>
        </dl>
     </for>

     </if>
      <div class="form_b" style="width: 300px; margin-left: 110px;">
        <input type="submit" class="button-green"  value="保 存">
        &nbsp;
        <input type="button" onclick="goUrl('{:U('/Home/Product/sell')}')" class="button-return" value="返回产品列表">
      </div>
    </form>
  </div>

  <elseif condition="$step eq '2'" />

  <div class="yScroll" id="includeCost">
    <form method='post' action="{:U('/Home/Webproduct/selledit',array('id'=>$id,'step'=>'2'))}">
      <dl>
        <dt>费用包含：</dt>
        <dd>
          <textarea name="costInclude" rows="10" cols="120" >{$detail.costInclude}</textarea>
        </dd>
      </dl>
      <dl>
        <dt>费用不含：</dt>
        <dd>
          <textarea name="costNoclude" rows="10" cols="120" >{$detail.costNoclude}</textarea>
        </dd>
      </dl>
      <dl>
        <dt>预订须知：</dt>
        <dd>
          <textarea name="reservationNotice" rows="10" cols="120" >{$detail.reservationNotice}</textarea>
        </dd>
      </dl>
      <dl>
        <dt>退订须知：</dt>
        <dd>
          <textarea name="unreservationNotice" rows="10" cols="120" >{$detail.unreservationNotice}</textarea>
        </dd>
      </dl>
      <div class="form_b" style="width: 300px; margin-left: 110px;">
        <input type="submit" class="button-green" value="保 存">
        &nbsp;
        <input type="button" onclick="goUrl('{:U('/Home/Product/sell')}')" class="button-return" value="返回产品列表">
      </div>
    </form>
  </div>

  <elseif condition="$step eq '5'" />

  <div class="yScroll" id="insurance">

      <div class="pircebox">
        <p style="font-size:20px; text-align: center;">当地游总成本</p>
        <div class="pricelist">

          <foreach name="LocalProductArr1" item="LocalProductArr">
          <dl id="libraryID_{$LocalProductArr.id}">
            <dt>{$LocalProductArr.title|subtext = 4}</dt>
            <dd>
              <font class="red" style="font-size:24px;">{$LocalProductArr.costPrice}</font>元
            </dd>
          </dl>
          </foreach>

        </div>
        <div>
          <p><a href="javascript:;" onclick="productTypeAjax('5','{$id}')">新增当地游</a></p>
        </div>
      </div>

        <ul class="piclist">
          <foreach name='LocalProductArr2' item='LocalProductArr'>
          <li>
            <div class="l">
              <div class="filebox">
                  <img src="{$LocalProductArr.uploadImg}"  width="150" height="120">
              </div>
            </div>
            <div class="l r-txt">
              <p style="font-size:14px;">{$LocalProductArr.title|subtext = 8}</p>
              <p><font class="red font24">{$LocalProductArr.costPrice}</font>元</p>
              <p><a href="javascript:;" onclick="getProductTypeHtml('5','{$id}','当地游','{$LocalProductArr.containID}','{$LocalProductArr.title}','{$LocalProductArr.id}')">编辑 </a>&nbsp;&nbsp;<a href="javascript:;" onclick="getProductTypeDel('{$LocalProductArr.id}')">删除</a></p>
            </div>
          </li>
          </foreach>
        </ul>
        <div class="clear"></div>
    </div>
  </div>

  <elseif condition="$step eq '6'" />

  <div class="yScroll" id="insurance">

      <div class="pircebox">
        <p style="font-size:20px; text-align: center;">附加保险总成本</p>
        <div class="pricelist">

          <foreach name="insuranceArr1" item="insuranceArr">
          <dl id="libraryID_{$insuranceArr.id}">
            <dt>{$insuranceArr.title|subtext = 4}</dt>
            <dd>
              <font class="red" style="font-size:24px;">{$insuranceArr.costPrice}</font>元
            </dd>
          </dl>
          </foreach>

        </div>
        <div>
          <p><a href="javascript:;" onclick="productTypeAjax('1','{$id}')">新增附加保险</a></p>
        </div>
      </div>

        <ul class="piclist">
          <foreach name='insuranceArr2' item='insuranceArr'>
          <li>
            <div class="l">
              <div class="filebox">
                  <img src="{$insuranceArr.uploadImg}"  width="150" height="120">
              </div>
            </div>
            <div class="l r-txt">
              <p style="font-size:14px;">{$insuranceArr.title|subtext = 8}</p>
              <p><font class="red font24">{$insuranceArr.costPrice}</font>元</p>
              <p style="font-size:12px;">加价：+{$insuranceArr.upPrice}元</p>
              <p><a href="javascript:;" onclick="getProductTypeHtml('1','{$id}','附加保险','{$insuranceArr.containID}','{$insuranceArr.title}','{$insuranceArr.id}')">编辑 </a>&nbsp;&nbsp;<a href="javascript:;" onclick="getProductTypeDel('{$insuranceArr.id}')">删除</a></p>
            </div>
          </li>
          </foreach>
        </ul>
        <div class="clear"></div>
    </div>
  </div>

  <elseif condition="$step eq '7'" />

  <div class="yScroll" id="coupon">

    <!-- <form method='post' action="{:U('/Home/Product/selledit',array('id'=>$id,'step'=>'7'))}">
      <dl>
        <dt></dt>
        <dd>
          <div id="picture_show" style="width:1000px">
            <foreach name='coupontypelist' item='v'>
              <div class="picture_item {$v.picture_item2}" >
                <label for="coupon{$v.id}">
                <div class="title">{$v.name}</div>
                <img width="120" height="120" src="<if condition='$v.litpic eq null'>__PUBLIC__/image/baoxian.jpg<else/>http://www.tripvip.cn{$v.litpic}</if>">
                <div class="description">¥{$v.amount}</div>
                </label>
                <input type="checkbox" id="coupon{$v.id}" name="coupon[]" value="{$v.id}" style="margin-left: 48px;" {$v.checked} />
              </div>
            </foreach>
          </div>
        </dd>
      </dl>
      <div class="picture_item {$v.picture_item2}" >
        <label for="coupon{$v.id}">
        <div class="title">{$v.name}</div>
        <img width="120" height="120" src="<if condition='$v.litpic eq null'>__PUBLIC__/image/baoxian.jpg<else/>http://www.tripvip.cn{$v.litpic}</if>">
        <div class="description">¥{$v.amount}</div>
        </label>
        <input type="checkbox" id="coupon{$v.id}" name="coupon[]" value="{$v.id}" style="margin-left: 48px;" {$v.checked} />
      </div>
      <dl>
        <dt> </dt>
        <dd>
          <input type="submit" class="button-green" value="保 存">
        </dd>
      </dl>
    </form> -->
    <div class="pircebox">
      <p style="font-size:20px; text-align: center;">优惠券总成本</p>

      <div class="pricelist">

        <foreach name="addProductArr1" item="addProductArr">
        <dl id="libraryID_{$addProductArr.id}">
          <dt>{$addProductArr.title|subtext = 4}</dt>
          <dd>
            <font class="red" style="font-size:24px;">{$addProductArr.costPrice}</font>元
          </dd>
        </dl>
        </foreach>

      </div>
      <div>
        <p><a href="javascript:;" onclick="productTypeAjax('6','{$id}')">新增优惠券</a></p>
      </div>
    </div>

    <ul class="piclist">

      <!-- <foreach name='addProductArr2' item='addProductArr'>
      <li>
        <div class="l">
          <div class="filebox">
              <img src="http://www.tripvip.cn{$addProductArr.uploadImg}"  width="150" height="120">
          </div>
        </div>
        <div class="l r-txt">
          <p style="font-size:14px;">{$addProductArr.title|subtext = 8}</p>
          <p><font class="red font24">{$addProductArr.costPrice}</font>元</p>
          <p><font>购买数量：</font>
            <if condition="$addProductArr['buyType'] eq '0'" >默认购买
              <elseif condition="$addProductArr['buyType'] eq 'O'" />一个
              <elseif condition="$addProductArr['buyType'] eq 'V'" />游客总数
              <elseif condition="$addProductArr['buyType'] eq 'T'" />成人总数
              <else />{$addProductArr.buyType}
            </if>
          </p>
          <p style="font-size:12px;">加价：+{$addProductArr.upPrice}元</p>
          <p><a href="javascript:;" onclick="getProductTypeHtml('2','{$id}','附加产品','{$addProductArr.containID}','{$addProductArr.title}','{$addProductArr.id}')">编辑 </a>&nbsp;&nbsp;<a href="javascript:;" onclick="getProductTypeDel('{$addProductArr.id}')">删除</a></p>
        </div>
      </li>
      </foreach> -->

    </ul>
  </div>

  <elseif condition="$step eq '8'" />

  <div class="yScroll" id="addproduct">
    <div class="pircebox">
      <p style="font-size:20px; text-align: center;">附加产品总成本</p>
      <div class="pricelist">

        <foreach name="addProductArr1" item="addProductArr">
        <dl id="libraryID_{$addProductArr.id}">
          <dt>{$addProductArr.title|subtext = 4}</dt>
          <dd>
            <font class="red" style="font-size:24px;">{$addProductArr.costPrice}</font>元
          </dd>
        </dl>
        </foreach>

      </div>
      <div>
        <p><a href="javascript:;" onclick="productTypeAjax('2','{$id}')">新增附加产品</a></p>
      </div>
    </div>
    <ul class="piclist">

      <foreach name='addProductArr2' item='addProductArr'>
      <li>
        <div class="l">
          <div class="filebox">
              <img src="{$addProductArr.uploadImg}"  width="150" height="120">
          </div>
        </div>
        <div class="l r-txt">
          <p style="font-size:14px;">{$addProductArr.title|subtext = 8}</p>
          <p><font class="red font24">{$addProductArr.costPrice}</font>元</p>
          <p><font>购买数量：</font>
            <if condition="$addProductArr['buyType'] eq '0'" >默认购买
              <elseif condition="$addProductArr['buyType'] eq 'O'" />一个
              <elseif condition="$addProductArr['buyType'] eq 'V'" />游客总数
              <elseif condition="$addProductArr['buyType'] eq 'T'" />成人总数
              <else />{$addProductArr.buyType}
            </if>
          </p>
          <p style="font-size:12px;">加价：+{$addProductArr.upPrice}元</p>
          <p><a href="javascript:;" onclick="getProductTypeHtml('2','{$id}','附加产品','{$addProductArr.containID}','{$addProductArr.title}','{$addProductArr.id}')">编辑 </a>&nbsp;&nbsp;<a href="javascript:;" onclick="getProductTypeDel('{$addProductArr.id}')">删除</a></p>
        </div>
      </li>
      </foreach>

    </ul>
    <div class="clear"></div>

  </div>

  <elseif condition="$step eq '9'" />

  <div class="yScroll" id="recommend">

    <form method='post' action="{:U('/Home/Webproduct/selledit',array('id'=>$id,'step'=>'9'))}">
      <dl>
        <dt>棉签妹推荐</dt>
        <dd>
          <input type="text" name="recommend" class="inp_w250" placeholder="10个字内"  maxlength="10" value="{$personRecommend.recommend}">
        </dd>
      </dl>
      <dl>
        <dt>棉签妹头像</dt>
        <dd>
          <div style="width: 120px; height: 120px;  border: 1px #CCC solid;   position: relative;   overflow: hidden; text-align: center;vertical-align: middle;cursor: pointer;">
            <input type="file" name="filedata" id="headerImg" onChange="uploadPic(this,'headerImg')" style="width:120px; height: 120px; position: absolute; right: 0;left: 0;bottom: 0;top: 0;margin: auto;opacity: 0;z-index: 9999">
            <div  class="fileupload" style="  position: absolute;width: 120px;height: auto;right: 0;left: 0;bottom: 0;top: 0;margin: auto;">
              <if condition="$personRecommend['headerImg'] neq '' ">
                  <img src="{$website_url}{$personRecommend.headerImg}" width="120" height="120" />
                  <input type="hidden" name="headerImg" class="headerImg" value="{$personRecommend.headerImg}">
              </if>
            </div>
          </div>
        </dd>
      </dl>
      <dl>
        <dt>棉签妹推荐原因</dt>
        <dd>
          <textarea rows="5" cols="33" style="resize: none;" name="reson" class="font_nums">{$personRecommend.reson}</textarea>
        </dd>
      </dl>
      <dl>
        <dt>棉签妹推荐航班原因</dt>
        <dd>
          <input type="text" name="recommendAirplaneReson" class="inp_w250"  value="{$personRecommend.recommendAirplaneReson}">
        </dd>
      </dl>
      <dl>
        <dt>棉签妹推荐酒店原因</dt>
        <dd>
          <input type="text" name="recommendHotleReson" class="inp_w250" value="{$personRecommend.recommendHotleReson}">
        </dd>
      </dl>
      <dl>
        <dt></dt>
        <dd>
          <input type="submit" class="button-green" value="保 存">
        </dd>
      </dl>
    </form>

  </div>

  <elseif condition="$step eq '10'" />

  <div class="yScroll" id="containProduct">

    <div class="pircebox">
      <p style="font-size:20px; text-align: center;">包含单品总成本</p>
      <div class="pricelist">

        <foreach name="productSingleArr1" item="productSingleArr">
        <dl id="libraryID_{$productSingleArr.id}">
          <dt>{$productSingleArr.title|subtext = 4}</dt>
          <dd>
            <font class="red" style="font-size:24px;">{$productSingleArr.costPrice}</font>元
          </dd>
        </dl>
        </foreach>

      </div>
      <div>
        <p><a href="javascript:;" onclick="productTypeAjax('3','{$id}')">新增包含单品</a></p>
      </div>
    </div>

      <ul class="piclist">
        <foreach name='productSingleArr2' item='productSingleArr'>
        <li>
          <div class="l">
            <div class="filebox">
                <img src="{$productSingleArr.uploadImg}" width="150" height="120">
            </div>
          </div>
          <div class="l r-txt">
            <p style="font-size:14px;">{$productSingleArr.title|subtext = 8}</p>
            <p><font class="red font24">{$productSingleArr.costPrice}</font>元</p>
            <p style="font-size:12px;">加价：+{$productSingleArr.upPrice}元</p>
            <p><a href="javascript:;" onclick="getProductTypeHtml('3','{$id}','包含单品','{$productSingleArr.containID}','{$productSingleArr.title}','{$productSingleArr.id}')">编辑 </a>&nbsp;&nbsp;<a href="javascript:;" onclick="getProductTypeDel('{$productSingleArr.id}')">删除</a></p>
          </div>
        </li>
        </foreach>
      </ul>
      <div class="clear"></div>
  </div>

  <elseif condition="$step eq '11'" />

  <div class="yScroll" id="giftsProduct">
    <div class="pircebox">
      <p style="font-size:20px; text-align: center;">赠送单品总成本</p>
      <div class="pricelist">

        <foreach name="giftsArr1" item="giftsArr">
        <dl id="libraryID_{$giftsArr.id}">
          <dt>{$giftsArr.title|subtext = 4}</dt>
          <dd>
            <font class="red" style="font-size:24px;">{$giftsArr.costPrice}</font>元
          </dd>
        </dl>
        </foreach>

      </div>
      <div>
        <p><a href="javascript:;" onclick="productTypeAjax('4','{$id}')">新增包含单品</a></p>
      </div>
    </div>
      <ul class="piclist">
        <foreach name='giftsArr2' item='giftsArr'>
        <li>
          <div class="l">
            <div class="filebox">
                <img src="{$giftsArr.uploadImg}" width="150" height="120">
            </div>
          </div>
          <div class="l r-txt">
            <p style="font-size:14px;">{$giftsArr.title|subtext = 8}</p>
            <p><font class="red font24">{$giftsArr.costPrice}</font>元</p>
            <p style="font-size:12px;">加价：+{$giftsArr.upPrice}元</p>
            <p><a href="javascript:;" onclick="getProductTypeHtml('4','{$id}','赠送单品','{$giftsArr.containID}','{$giftsArr.title}','{$giftsArr.id}')">编辑 </a>&nbsp;&nbsp;<a href="javascript:;" onclick="getProductTypeDel('{$giftsArr.id}')">删除</a></p>
          </div>
        </li>
        </foreach>
      </ul>
      <div class="clear"></div>

  </div>

  <elseif condition="$step eq '12'" />
  
  <div class="yScroll" id="departureDate">
    <div class="operate2">
      <ul>
        <li>
          <select name="libraryID" onChange="selectDepartureDate(this,'{$id}','{$step}')">
            <option value="0">全部</option>
            <foreach name="departureArr" item="departureArr">
            <option value="{$departureArr.libraryID}"  <if condition="$libraryID eq $departureArr['libraryID']" >selected </if> >{$departureArr.departureName}</option>
            </foreach>
          </select>
        </li>
        <li onclick="iframeSrcDepartureDate('{:U(MODULE_NAME.'/Webproduct/departureDate',array('productID'=>$id))}','{$product['title']}')"><span class="icon-add01"></span>新增出行日期</li>
      </ul>
      <div class="clear"></div>
    </div>
    <table class="list">
        <thead>
          <tr>
            <th>发团日期</th>
            <th>成人价格</th>
            <th>儿童价格</th>
            <th>余位</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <foreach name='departureDateArr' item='departureDateArr'>
            <tr>
               <td style="text-align: center;">{$departureDateArr.departureTime|date='Y-m-d', ###} </td>
               <td style="text-align: center;">￥{$departureDateArr.adultPrice}</td>
               <td style="text-align: center;">￥{$departureDateArr.childPrice}</td>
               <td style="text-align: center;">{$departureDateArr.seat}</td>
               <td style="text-align: center;">
                   <a href="javascript:;" onclick="toConfirm('{:U(MODULE_NAME.'/Webproduct/departureDateDel',array('id' => $departureDateArr['id']))}', '确实要删除吗？')">删除</a>
               </td>
           </tr>
          </foreach>
     </tbody>
    </table>
    <div class="page" style="clear: both;">{$page}</div>
  </div>

  <elseif condition="$step eq '13'" />

  <div class="yScroll" id="flightInfo">
      <div class="operate2">
        <ul>
          <!-- <li onclick="iframeSrcAirplaneInfo('{:U(MODULE_NAME.'/Product/airplaneInfo',array('productID'=>$id))}','{$product['title']}')"><span class="icon-add01"></span>新增航线信息</li> -->
          <li onclick="airLineSet('{$id}','{$product['title']}','{:U(MODULE_NAME.'/Webproduct/airpLineSetPost',array('productID'=>$id))}')"><span class="icon-add01"></span>新增航线信息</li>
          <!-- <li onclick="iframeSrcAirplaneInfo('{:U(MODULE_NAME.'/Product/departureDate',array('productID'=>$id))}','{$product['title']}')"><span class="icon-add01"></span>新增航线信息</li> -->
        </ul>
        <div class="clear" ></div>
      </div>
      <table class="list">
          <thead>
          <tr>
              <th>航班标题</th>
              <th>出发信息</th>
              <th></th>
              <th>到达信息</th>
              <th>航班信息</th>
              <th>座位数(余位)</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
          <foreach name='airLineArr' item='airLineArr'>
            <tr>
              <th colspan="2" style="color:#F00; font-size:14px; font-weight:bold">{$key+1}、 {$airLineArr.title}</th>
              <th colspan="3">{$airLineArr.description}</th>
              <th></th>
              <th>
                <a href="javascript:;" onclick="airLineSet('{$id}','{$product['title']}','{:U(MODULE_NAME.'/Webproduct/airpLineSetPost',array('productID'=>$id,'id'=>$airLineArr['id']))}','{$airLineArr['id']}')">编辑</a>
                <a href="javascript:;" onclick="iframeSrcAirplaneInfo('{:U(MODULE_NAME.'/Webproduct/airplaneInfo',array('productID'=>$id,'airlineID'=>$airLineArr['id']))}','{$product['title']}')">新增航班</a>
              </th>
            </tr>

            <foreach name='airLineArr.airLineInfo' item='airLineInfo'>
              <tr>
                 <td style="text-align: center;">{$airLineInfo.title}(<if condition="$airLineInfo.type eq '0'">去程<elseif condition="$airLineInfo.type eq '1'" />转机<elseif condition="$airLineInfo.type eq '2'" />回程<else />去程</if>)</td>
                 <td style="text-align: center;">{$airLineInfo.departureTime|date = 'H:i',###} 从 {$airLineInfo.departurePlace}{$airLineInfo.departureAirport} 出发</td>
                 <td style="text-align: center;"><img src="__PUBLIC__/image/agreemegent.png" style="margin:10px"/></td>
                 <td style="text-align: center;">{$airLineInfo.destinationTime|date = 'H:i',###} 到达 {$airLineInfo.destinationPlace} {$airLineInfo.destinationAirport}</td>
                 <td style="text-align: center;">{$airLineInfo.flightName}/{$airLineInfo.flightNumber}/{$airLineInfo.airplaneModel}</td>
                 <td style="text-align: center;">{$airLineInfo.seat}</td>
                 <td style="text-align: center;">
                     <a href="javascript:;" onclick="iframeSrcAirplaneInfo('{:U(MODULE_NAME.'/Webproduct/airplaneInfo',array('productID'=>$id,'id'=>$airLineInfo['id']))}','{$product['title']}')" >编辑</a>&nbsp;
                     <a href="javascript:;" onclick="toConfirm('{:U(MODULE_NAME.'/Webproduct/airplaneInfoDel',array('id' => $airLineInfo['id']))}', '确实要删除吗？')" >删除</a>
                 </td>
              </tr>
            </foreach>

         </foreach>
       </tbody>
      </table>
      <div class="page" style="clear: both;">{$page}</div>
  </div>

  <elseif condition="$step eq '14'" />

  <div class="yScroll" id="hotelInfo">
    <div class="operate2">
        <ul>
          <li onclick="iframeSrcHotel('{:U(MODULE_NAME.'/Webproduct/hotelInfo',array('productID'=>$id))}','{$product['title']}')"><span class="icon-add01"></span>新增酒店信息</li>
        </ul>
        <div class="clear"></div>
      </div>
    <table class="list">
      <thead>
        <tr>
            <th>酒店标题</th>
            <th>酒店信息</th>
            <th>酒店地址</th>
            <th>单房差</th>
            <th>酒店升级差</th>
            <th>操作</th>
        </tr>
      </thead>
      <tbody>
      <foreach name='hotelArr' item='hotelArr'>
        <tr>
         <td style="text-align: center;">{$hotelArr.hotelTitle}</td>
         <td style="text-align: center;"><img src="{$website_url}{$hotelArr.litpic}" width="160" height="120" /><br />{$hotelArr.hotelName} {$hotelArr.ename}</td>
         <td style="text-align: center;">{$hotelArr.address}</td>
         <td style="text-align: center;">￥{$hotelArr.spreadHotel}</td>
         <td style="text-align: center;">￥{$hotelArr.updateHotel}</td>
         <td style="text-align: center;">
             <a href="javascript:;" onClick="iframeSrcHotel('{:U(MODULE_NAME.'/Webproduct/hotelInfo',array('id'=>$hotelArr['id'],'productID'=>$id))}','{$product['title']}')">编辑</a>&nbsp;&nbsp;
             <a href="javascript:;" onclick="toConfirm('{:U(MODULE_NAME.'/Webproduct/hotelInfoDel',array('id' => $hotelArr['id']))}', '确实要删除吗？')">删除</a>
         </td>
        </tr>
      </foreach>
      </tbody>
    </table>
    <div class="page" style="clear: both;">{$page}</div>
  </div>

  <elseif condition="$step eq '15'" />

  <div class="operate2">
    <ul>
      <li onclick="iframeSrcTravelreference('{:U(MODULE_NAME.'/Webproduct/travelreferenceInfo',array('productID'=>$id))}','{$product['title']}')"><span class="icon-add01"></span>新增行程信息</li>
    </ul>
    <div class="clear"></div>
  </div>
  <table class="list">
    <tr>
      <th width="15%">行程标题</th>
      <th width="60%">行程内容</th>
      <th width="10%">操作</th>
    </tr>
    <foreach name='travelreferenceArr' item='travelreferenceArr'>
    <tr>
      <td style="text-align: center;">{$travelreferenceArr.title}</td>
      <td style="text-align: center;">{$travelreferenceArr.content}</td>
      <td style="text-align: center;">
        <a href="javascript:;"  onclick="iframeSrcTravelreference('{:U(MODULE_NAME.'/Webproduct/travelreferenceInfo',array('id'=>$travelreferenceArr['id'],'productID'=>$id))}','{$product['title']}')">编辑</a>&nbsp;&nbsp;
        <a href="javascript:;" onclick="toConfirm('{:U(MODULE_NAME. '/Webproduct/travelreferenceInfoDel',array('id' => $travelreferenceArr['id']))}', '确实要删除吗？')">删除</a>
      </td>
    </tr>
    </foreach>
  </table>
  <div class="page" style="clear: both;">{$page}</div>
  </if>
  </div>

 <script type="text/javascript">
 $(function  () {
    $('table td p img').height('300');
  })

/**
 * [destination_add description]
 * @return {[type]} [description]
 */
function destinationHtmlAdd(obj)
{

  var i = '0';
  $(obj).parent().parent().parent().find('select').each(function(index, el) {
    if(el.value == '0'){i++;}
  });

  if(i == '0')
  {
    if($('.selectDestinationNums').length < 3)
    {
      var html = '';
      html += '<div class="selectDestinationNums" style="margin-top: 10px;">';
          html += '<div class="selectDestination" style="float: left;">';
            html += '{$destinationHtml.areaSelect}';
            html += '&nbsp;';
            html += '{$destinationHtml.countrySelect}';
            html += '&nbsp;';
            html += '{$destinationHtml.citySelect}';
          html += '</div>';
          html += '<div class="operateDestination" style="float: left;">';
            html += '<a href="javascript:;" onclick="destinationHtmlDel(this)">删除</a>';
          html += '</div>';
          html += '<div class="clear"></div>';
      html += '</div>';
      $(obj).parent().parent().parent().append(html);
    }
    else
    {
       layer.msg('暂只支持最多三个目的地');
    }
  }
  else
  {
    layer.msg('请填写完整已有的目的地选项');
  }
}


/**
 * [uploadImgHtml description]
 * @return {[type]} [description]
 */
function uploadImgHtml(thumbImages)
{
  var sizeType = 0;
  switch (thumbImages) 
  {
    case 'thumbImages':
      sizeType = 0;
      break;
    case 'originalImagesPC':
      sizeType = 1;
      break;
  }

  var cityID = $('select[name="cityID[]"]:first').val();

  //iframe层-父子操作
  var Div = layer.open({
              type: 2,
              area: ['800px', '400px'],
              content: ['/Home/Public/uploadImages.html?type=Product&sizeType='+sizeType+'&cityID='+cityID,'no'],
              btn: ['确认','取消'], //按钮
              yes: function(index, layero){ //或者使用btn1
                  //按钮【按钮一】的回调
                  
                  var obj = $(window.frames['layui-layer-iframe'+index].document);
                  var object = obj.find("#selectImg ul li .curr");
                  if(object.length <= 0)
                  {
                    var imgUrl = obj.find("#dndArea input[name='fileData[]']").val();
                  }
                  else
                  {
                    var imgUrl = object.parent().find('img').attr('src')
                  }

                  $('#'+thumbImages).empty();
                  $('#'+thumbImages).append('<img src="'+imgUrl+'" width="100%" height="100%"><input type="hidden" name="'+thumbImages+'" class="headerImg" value="'+imgUrl+'">');
                  layer.close(Div);
              },
              cancel: function(index){ //或者使用btn2
                  //按钮【按钮二】的回调
                  layer.close(Div);
              }
          });
}
</script>